import org.rsbot.script.methods.Calculations;
import org.rsbot.script.methods.Walking;
import org.rsbot.script.wrappers.RSNPC;
import org.rsbot.script.wrappers.RSPlayer;

class VoluntaryThieve$Actions$1 extends VoluntaryThieve.Action
{
  RSNPC trainer;

  VoluntaryThieve.Action.State perform()
  {
    if (this.trainer == null) {
      if ((this.val$args.length != 1) || (!(this.val$args[0] instanceof RSNPC)))
        throw new IllegalArgumentException();
      this.trainer = ((RSNPC)this.val$args[0]);
    }

    if (!VoluntaryThieve.access$3900(this.this$1.this$0).tileOnMap(this.trainer.getLocation())) return VoluntaryThieve.Action.State.FAILED;
    return VoluntaryThieve.access$4000(this.this$1.this$0).walkTileMM(this.trainer.getLocation(), 2, 2) ? VoluntaryThieve.Action.State.COMPLETED : VoluntaryThieve.Action.State.PROGRESSING;
  }

  VoluntaryThieve.Action.State confirm()
  {
    return this.this$1.this$0.getMyPlayer().isMoving() ? VoluntaryThieve.Action.State.COMPLETED : VoluntaryThieve.Action.State.PROGRESSING;
  }

  VoluntaryThieve.Action.State finish()
  {
    if (VoluntaryThieve.access$4100(this.this$1.this$0).distanceTo(this.trainer) > this.this$1.this$0.random(4, 7))
      VoluntaryThieve.Antibans.access$4300(VoluntaryThieve.access$4200(this.this$1.this$0), new int[] { 0 }, this.this$1.this$0.random(17, 23));
    return this.trainer.isOnScreen() ? VoluntaryThieve.Action.State.COMPLETED : VoluntaryThieve.Action.State.PROGRESSING;
  }
}